<template>
  <div>

  </div>
</template>

<script>
export default {
    data(){
        return{

        }
    },
    mounted(){
        let parm=new FormData()
        this.axios.post('http://localhost:8000/ding_login/',parm).then((response)=>{
            if(response.data.code==200){
                this.$toast('登录成功')
                localStorage.setItem('username',response.data.username)
                localStorage.setItem('token',response.data.token)
                localStorage.setItem('uid',response.data.uid)
                this.$router.push({path:'/'})
            }else{
                this.$toast(response.data.message)
            }
        })
    }
}
</script>

<style>

</style>